Beginning: iOS 5 Application Development by Wei-Meng Lee

Beginning: iOS 5 Application Development by Wei-Meng Lee

Author:Wei-Meng Lee
Language: eng
Format: epub
Publisher: John Wiley & Sons
Published: 2011-12-09T16:00:00+00:00


CGAffineTransformMakeScale()takes two arguments: the factor to scale for the x axis and the factor to scale for the y axis. For simplicity, I have used the angle variable for the scale factor for both the x and y axes.

If you modify the previous Try It Out with the preceding statement, the tennis ball gets bigger as it bounces on the screen (see Figure 13-8). It then resets back to its original size and grows again.

FIGURE 13-8

ANIMATING A SERIES OF IMAGES

So far, you have seen that you can use an Image View to display a static image. In addition, you can use it to display a series of images and then alternate between them.

The following Try It Out shows how this is done using an Image View.

TRY IT OUT: Displaying a Series of Images

codefile Animations2.zip is available for download at Wrox.com

1. Using Xcode, create a new Single View Application (iPhone) project and name it Animations2.

2. Add a series of images to the project by dragging and dropping them into the Supporting Files folder in Xcode. When the Add dialog appears, check the Copy Item into Destination Group’s Folder (If Needed) option so that each of the images will be copied into the project. Figure 13-9 shows the images added.

FIGURE 13-9



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.